from __future__ import absolute_import, unicode_literals
import os
from celery import Celery

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drf_movie_rimi.settings')

#启动项目的名字 最好和项目名字一样 broker中间件  backend 存储结果的地方
app = Celery('drf_movie_rimi',
             broker='redis://localhost:6379/2',
             backend='redis://localhost:6379/6'

             )

#在redis中以CELERY
app.config_from_object('django.conf:settings', namespace='CELERY')

#使celery能够读取到所有apps里面分配的任务
app.autodiscover_tasks()
